<div ng-controller="pictureManagerCtl">
    <div class="table-header lh30 clearfix ng-scope">
        <span class="fl lh30 f14">图片管理</span>

        <div class="fr btn-group">
            <input class="input-text fl w200 ml3" style="width: 470px;" type="text"
                   placeholder="请输入主题关键字搜索"
                   ng-if="userAuthList.indexOf('1020') !== -1"
                   ng-model="Page.query.keyword"
                   ng-enter="Page.reset()"/>
            <a class="btn" ng-click="Page.reset()"
               ng-if="userAuthList.indexOf('1020') !== -1">查询</a>
            <a class="btn" ui-dialog="新增图片"
               ng-if="userAuthList.indexOf('1021') !== -1"
               ui-dialog-before-show="editor.boforeShow($dialog, $dialogScope)"
               ui-dialog-ok="editor.save($data)"
               ui-dialog-template="{{editTemplate}}">新增</a>
        </div>
    </div>

    <div id="grid" class="table-responsive mt10">
        <table class="table table-hover">
            <thead>
            <tr>
                <th width="40" class="text-center">序号</th>
                <th width="120">图片类型</th>
                <th width="160">图片主题</th>
                <th width="250">链接地址</th>
                <th width="70">启用状态</th>
                <th width="80">显示顺序</th>
                <th width="150">修改时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="pic in Page.pictures">
                <td class="text-center"><p ng-bind="$index + 1"></p></td>
                <td>
                    <div style="width: 100px;" title="{{pic.type | picTypeFilter}}">{{pic.type | picTypeFilter}}</div>
                </td>
                <td>
                    <div style="width: 150px;" title="{{pic.title}}">{{pic.title}}</div>
                </td>
                <td>
                    <div style="width: 200px;" title="{{pic.redirect_url}}">{{pic.redirect_url}}</div>
                </td>
                <td>
                    <div style="width: 60px;" title="{{pic.is_able | isAbleFilter}}">{{pic.is_able | isAbleFilter}}
                    </div>
                </td>
                <td>
                    <div style="width: 60px;" title="{{pic.sort}}">{{pic.sort}}</div>
                </td>
                <td>
                    <div style="width: 120px;" title="{{pic.modified_time}}">{{pic.modified_time}}</div>
                </td>
                <td>
                    <div style="width: 150px;" row-toolbar min-buttons-show="8"
                         ng-if="userAuthList.indexOf('1021') !== -1">
                        <a class="tab-text" style="display: inline-block;" ui-dialog="编辑图片"
                           ui-dialog-before-show="editor.boforeShow($dialog, $dialogScope, pic)"
                           ui-dialog-ok="editor.save($data)"
                           ui-dialog-template="{{editTemplate}}">编辑</a>
                        <a class="ml10 tab-text" style="display: inline-block;" ng-click="Page.toggleAble(pic)">
                            {{pic.is_able == '1' ? '禁用': '启用'}}</a>
                        <a class="ml10 tab-text" style="display: inline-block;" ui-dialog="删除"
                           ui-dialog-ok="Page.delete(pic)"
                           ui-dialog-template="确定要删除{{pic.title}}吗?">删除</a>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="no-data" ng-hide="Page.pictures.length"><span>暂无数据</span></div>
    </div>
    <div ui-pagination page-index="Page.pagination.pageIndex" total="Page.pagination.total"
         page-size="Page.pagination.pageSize"
         changed="Page.pagination.change($pageIndex - 1, Page.pagination.pageSize)"></div>
</div>
